#include "chartform.h"
#include "ui_chartform.h"

ChartForm::ChartForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ChartForm)
{
    ui->setupUi(this);
    zhexianDemo();
}

ChartForm::~ChartForm()
{
    delete ui;
}

void ChartForm::zhexianDemo()
{
    QVector<double> x(10),y(10);
    for(int i=0;i<10;i++)
    {
        x[i] = i;
        y[i] = qrand()%100;
    }
    ui->customPlot->addGraph();
    ui->customPlot->graph(0)->setData(x,y);

    ui->customPlot->xAxis->setLabel("x");
    ui->customPlot->yAxis->setLabel("y");

    ui->customPlot->xAxis->setRange(0,10);
    ui->customPlot->yAxis->setRange(0,100);

}
